package com.example.demo.core.exception;

public class ServiceException extends Exception{
    private int status;
    private String msg;
    public ServiceException(int status, String msg) {
        super(msg);
        this.status = status;
        this.msg = msg;
    }

    public ServiceException(StatusCode error) {
        super(error.getDesc());
        this.status = error.getCode();
        this.msg = error.getDesc();
    }

    public String getMessage() {
        return msg;
    }

    public int getStatus() {
        return status;
    }
}
